$(function() {
	


	 function loginOut() {
		$
				.ajax({
					type : 'post',
					url : '${pageContext.request.contextPath}/user/loginOut.action',
					success : function(data) {
						window.location.href="${pageContext.request.contextPath}";
					}
				});

	}

	function device_effect() {
		$
				.ajax({
					type : 'post',
					url : '${pageContext.request.contextPath}/jsp/device/device_analysis.jsp',
					dataType : 'html',
					success : function(data) {
						$("#main-content").html(data);
					}
				});
	}

	function alerts() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/jsp/alerts/alerts.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	
	function equipmanage() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/equipment/getList.action',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function summy() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/jsp/database.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function consummonitor() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath }/consums/getList.action',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function equipmonitor() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath }/equip/getList.action',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function elec_meter() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/jsp/elect_meter.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function energy_usage() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/jsp/machine.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function consum_plan() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/jsp/CostManager.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}
	function cost_Analysis() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/jsp/costAnalysis.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function userInfo(username) {

		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/user/getUserInfo.action',
			data : {
				name : username
			},
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	}

	function param_config() {
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/jsp/param_config.jsp',
			dataType : 'html',
			success : function(data) {
				$("#main-content").html(data);
			}
		});
	} 

	
})